home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 7 / FM Towns Free Software Collection 7.iso / t_os / artemis / artsrc2 / ginit2.asm < prev    next >
Assembly Source File  |  1993-11-30  |  2KB  |  93 lines

  1. ;    私製ライブラリ  パート2
  2. ;    (c) MATSUUCHI Ryosuke in Dec,1992
  3. ;
  4. ;    ginit2.asm : 初期化
  5.  
  6.         .386p
  7.  
  8.         public    _ginit, ginit, _egbwork
  9.         public    _callEGB
  10.         public    _egbwork, _scrmod, _wrtpage, _nowscrmod
  11.  
  12.         assume    cs:cseg, ds:dseg
  13.  
  14. dseg segment
  15.  
  16.         align    4
  17. __dmy__        db    4 dup (0)
  18. _egbwork    db    1536 dup (0)    ;EGBライブラリ用ワークエリア
  19. _scrmod        dd    0        ;ページ0の画面モード
  20.         dd    0        ;ページ1の画面モード
  21.         dd    0        ;仮想画面0の画面モード
  22.         dd    0        ;仮想画面1の画面モード
  23.         dd    0        ;仮想画面2の画面モード
  24.         dd    0        ;仮想画面3の画面モード
  25. _nowscrmod    dd    0        ;現在ページの画面モード
  26. _wrtpage    dd    0
  27.  
  28. dseg ends
  29.  
  30.  
  31.  
  32. cseg segment
  33.  
  34. ;---------------------------------------------------------------
  35. ;    _callEGB : グラフィックBIOSの呼び出し
  36. ;        in  AH     機能コード
  37. ;            DS:ESI パラメータ領域のアドレス
  38. ;---------------------------------------------------------------
  39.  
  40.         align    4
  41.  
  42. _callEGB    proc
  43.         push    edi
  44.         push    ds
  45.         pop    gs
  46.         mov    edi,offset _egbwork
  47.         push    dword ptr 0110h
  48.         pop    fs
  49.         call    pword ptr fs:[20h]
  50.         pop    edi
  51.         ret
  52. _callEGB    endp
  53.  
  54. ;---------------------------------------------------------------
  55. ;    _ginit : 私製ライブラリの初期化
  56. ;        in  none
  57. ;        out none
  58. ;
  59. ;    void    ginit()
  60. ;---------------------------------------------------------------
  61.  
  62. ginit        proc    near
  63. _ginit:
  64.         push    eax
  65.         push    ecx
  66.         xor    ax,ax
  67.         mov    ecx,1536
  68.         call    _callEGB
  69.         mov    eax,3
  70.         mov    [_nowscrmod],eax
  71.         mov    [_scrmod+0],eax
  72.         mov    [_scrmod+4],eax
  73.         sub    eax,eax
  74.         mov    [_wrtpage],eax
  75.         pop    ecx
  76.         pop    eax
  77.         ret
  78. ginit        endp
  79.  
  80. ;---------------------------------------------------------------
  81. ;    __setvadr : VRAM(または仮想VRAM)のポインタの設定
  82. ;            ※(私製ライブラリの内部ルーチン)
  83. ;        in  none
  84. ;        out none
  85. ;---------------------------------------------------------------
  86.  
  87.  
  88.  
  89.  
  90. cseg ends
  91.  
  92. end
  93.